home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-07-30 | 857 b | 40 lines | [TEXT/MPS ] |
-
- UNIT GetQDGlobs;
-
- INTERFACE
-
- USES
- Types, QuickDraw, OSUtils;
-
- TYPE
- QDVarRecPtr = ^QDVarRec;
- QDVarRec = RECORD
- randSeed : Longint;
- screenBits : BitMap;
- arrow : Cursor;
- dkGray : Pattern;
- ltGray : Pattern;
- gray : Pattern;
- black : Pattern;
- white : Pattern;
- thePort : GrafPtr;
- END;
-
- PROCEDURE GetMyQDVars (VAR qdVars: QDVarRec);
-
- IMPLEMENTATION
-
- PROCEDURE GetMyQDVars (VAR qdVars: QDVarRec);
- TYPE
- LongPtr = ^Longint;
- BEGIN
- { Algorithm:
- 1. Get current value of A5 with SetCurrentA5.
- 2. Dereference to get address of thePort.
- 3. Perform arithmetic to determine address of randSeed.
- 4. By assignment, copy the QD globals into a local data structure. }
- qdVars := QDVarRecPtr( LongPtr(SetCurrentA5)^ - (SizeOf(QDVarRec) - SizeOf(thePort)) )^;
- END;
-
- END.
-